package i2.application.checklist.services.impl;

import i2.application.checklist.dao.LivrableDao;
import i2.application.checklist.entities.Livrable;
import i2.application.checklist.services.LivrableService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Transactional;


@Transactional
public class LivrableServiceImpl implements LivrableService {

	private static final Logger logger = LoggerFactory.getLogger(LivrableServiceImpl.class);

	private LivrableDao livrableDao;

	@Override
	public void createLivrable(Livrable livrable) {
		logger.debug("creation du livrable : {}",livrable);
		livrableDao.add(livrable);
	}
	
	@Override
	public Livrable updateLivrable(Livrable livrable) {
		return livrableDao.update(livrable);
	}

	@Override
	public void deleteLivrable(Livrable Livrable) {
		livrableDao.delete(Livrable);
	}
	
	@Override
	public Livrable getLivrable(Livrable livrable) {
		return livrableDao.findById(livrable.getId());
	}

	@Override
	public void setLivrableDao(LivrableDao livrableDao) {
		this.livrableDao = livrableDao;
	}

	

}
